<?php

namespace app\common\validate;

use think\Validate;

class Cart extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
    	'id' => 'require|integer|gt:0',
    	'goods_record_id' => 'require|integer|gt:0',
	    'number' => 'require|integer|gt:0',
    ];
    /**
     * 提示消息
     */
    protected $message = [
    	'id' => '参数错误',
	    'goods_record_id' => '期数格式不正确',
	    'number.require' => '数量必需大于0',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [ 'goods_record_id', 'number'],
        'edit' => ['id', 'number'],
    ];
    
}
